const mysql = require('../config/db')
const { DataTypes } = require('sequelize')
require('dotenv').config()
const PostTag = mysql.define(
  'post_tags',
  {
    postId: {
      type: DataTypes.BIGINT,
      primaryKey: true,
      autoIncrement: true,
    },
    tagId: {
      type: DataTypes.BIGINT,
      allowNull: false,
    },
    deletedAt: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    createdAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
    updatedAt: {
      type: DataTypes.DATE,
      allowNull: false,
    },
  },
  {
    timestamps: true,
    tableName: 'post_tags',
    paranoid: false,
    deletedAt: process.env['DELETED_AT'],
  },
)
module.exports = PostTag
